/*
 * @Author: zxc
 * @Date: 2020-11-15 09:22:59
 * @LastEditTime: 2020-11-15 09:35:54
 * @LastEditors: zxc
 * @Description:抽象类 => 咖啡与茶
 */
abstract class TestModal {
  boilWater(): void {
    console.log("煮水")
  }
  abstract brewCoffeeGriends(): void
  abstract pourInCup(): void
  abstract addSugarAndMilk(): void
  init() {
    this.boilWater()
    this.brewCoffeeGriends()
    this.pourInCup()
    this.addSugarAndMilk()
  }
}
class TestCoofie extends TestModal {
  constructor() {
    super()
  }
  brewCoffeeGriends(): void {
    console.log("水冲咖啡")
  }
  pourInCup(): void {
    console.log("倒咖啡")
  }
  addSugarAndMilk(): void {
    console.log("注入灵魂")
  }
}
class TestTea extends TestModal {
  constructor() {
    super()
  }
  brewCoffeeGriends(): void {
    console.log("水冲茶")
  }
  pourInCup(): void {
    console.log("茶入杯")
  }
  addSugarAndMilk(): void {
    console.log("装逼开始")
  }
}

let coofies = new TestCoofie()
let teas = new TestTea()
coofies.init()
teas.init()
